module WWW
  class Ali
    class Util
      class Api
        attr_reader :user_id,:app_id,:app_instance_id,:token,:sip_sessionid,:sip_timestamp
        def initialize(request,session)
          @user_id = request[:user_id]
          @app_id  = request[:app_id]
          @app_instance_id=request[:app_instance_id]
          @token = request[:token]
          @sip_sessionid = session[:sip_sessionid]
          @sip_timestamp=Time.now.strftime("%Y-%m-%d %H:%M:%S")
        end

        def get_params
          ret_val = Hash.new
          ##系统级别参数
          ret_val['sip_appkey']=WWW::Ali.get_app_id
          ret_val['sip_timestamp']=@sip_timestamp
          ret_val['sip_sessionid']=@sip_sessionid
          ret_val['sip_format']='json'

          return ret_val
        end
      end
    end
  end
end
